#!/usr/bin/env bash
set -euo pipefail
outfile="${1:-capture_$(date +%s).pcapng}"
duration="${2:-15}"
iface="${3:-any}"
echo "Capturing to $outfile for $duration seconds on $iface"
tcpdump -i "$iface" -w "$outfile" -G "$duration" -W 1 'tcp port 80 or 443'
